#include "StreamSocket.h"
#include <boost/archive/text_oarchive.hpp> 
#include <boost/archive/text_iarchive.hpp> 
#include <boost/property_tree/ptree_serialization.hpp>
#include <boost/serialization/string.hpp>
int main( int argc, char **argv) {
	
	
	try {
		boost::asio::io_service ios;
		ptree cfg, net;

		
		StreamSocket client( ios );

		read_json( argv[1], cfg );
		write_json( "test", cfg );
		net = cfg.get_child("core.network");
		client.Connect( net );
		std::stringstream ss; 
// 		boost::archive::text_oarchive oa(ss);
// 		oa << cfg;
		
		ios.run();
		write_json( ss, cfg, false);
// 		write_json( "check", cfg );
		printf("%s\n", ss.str().c_str());
	} catch (std::exception& e)
	{
		std::cerr << e.what() << std::endl;
	}

}
